const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  // ...
  plugins: [
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'public/index.html', // 指定模板文件
      // 添加时间戳到HTML中的静态资源链接
      inject: true,
      minify: { collapseWhitespace: true }, // 可选的压缩配置
      hash: true // 添加哈希到静态资源链接
    })
  ],
}